<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@page contentType="text/html;charset=UTF-8"
	import="com.srit.forecast.constant.Constant"%>
<%@page pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>

<html>
<head>
<title></title>
<link href="<c:url value="/resources/css/style.css" />" rel="stylesheet"
	type="text/css">
<link href="<c:url value="/resources/css/list_css.css" />"
	rel="stylesheet" type="text/css">
<link href="<c:url value="/resources/css/forecast.css" />"
	rel="stylesheet" type="text/css">
</head>
<script>
	$(function() {
		$('.toolbar-img').each(function() {
			//var maxWidth = 100; // 图片最大宽度
			var maxHeight = 25; // 图片最大高度
			var ratio = 0; // 缩放比例
			var width = $(this).width(); // 图片实际宽度
			var height = $(this).height(); // 图片实际高度
			// 检查图片是否超高
			if (height > maxHeight) {
				ratio = maxHeight / height; // 计算缩放比例
				$(this).css("height", maxHeight); // 设定实际显示高度
				width = width * ratio; // 计算等比例缩放后的高度
				$(this).css("width", width * ratio); // 设定等比例缩放后的高度
			}
		});
	})
</script>

<body>
	<div class="menu2">
		<div class="menu2_top">
			<span>工具栏</span>
		</div>
		<div class="ui-widget ui-helper-clearfix toolbar-div">
			<c:forEach var="bean" items="${codeTypeList }">
				<div>
					<img src="<c:url value="/resources/images/drag_title.png" />" /> <span>${bean.type}</span>
				</div>
				<ul
					class="gallery ui-helper-reset ui-helper-clearfix toolbar-ul codeType${bean.id}">
					<c:forEach var="son" items="${bean.codeList}">
						<c:if test="${son.image!=null }">
							<li class=" ui-corner-tr">
								<h5 class="ui-widget-header">${son.name}</h5> <input
								type="hidden" value="${son.id}" /> <a href="javascript:void(0)">
									<img class="toolbar-img"
									src='<c:url value="/upload/${son.image }"></c:url>'
									alt="${son.name}" class="ui-corner-all" />
							</a>
							</li>
						</c:if>
					</c:forEach>
				</ul>
			</c:forEach>
		</div>
		<div
			style="height: 1px; border-top: 1px solid rgb(205, 205, 205); width: 100%">&nbsp;</div>
		<div class="menu2_foot">
			<img src="<c:url value="/resources/images/more.png" />" />更多功能
		</div>
	</div>
</body>
</html>